package online.heycm.platform.rocketmq.consumer;

import online.heycm.platform.rocketmq.common.entity.Constant;
import online.heycm.platform.rocketmq.common.entity.Event;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;

/**
 * 广播事件监听
 *
 * @author heycm
 * @since 2023/12/9 14:49
 */
@RocketMQMessageListener(topic = "${rocketmq.topic}" + Constant.BROADCAST_SUFFIX,
        consumerGroup = "${rocketmq.topic}" + Constant.BROADCAST_SUFFIX, messageModel = MessageModel.BROADCASTING)
public class BroadcastListener implements RocketMQListener<Event> {

    @Override
    public void onMessage(Event event) {
        EventRegistry.onMessage(event);
    }
}
